//
//  UIButton(jxsCustomized).m
//  ToDoList
//
// This code file is apart of project "iPhone-ToDo-List" 
// (http://code.google.com/p/iphone-todo-list/)
//
// Copyright (c) 2009 Frank Villasenor
//
// Distributed under the terms of the Lesser GNU General Public License.
// A copy of the license should be with these files. If not, you 
// can retrieve a copy from http://www.gnu.org/licenses/lgpl-3.0.txt
// 

#import "UIButton(jxsCustomized).h"


@implementation UIButton(jxsCustomized)

- (void)stylizeButtonWithStockCustomImages
{	
	UIImage *buttonImageNormal = [UIImage imageNamed:@"whiteButton.png"];
	UIImage *stretchableButtonImageNormal = [buttonImageNormal stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	
	UIImage *buttonImagePressed = [UIImage imageNamed:@"blueButton.png"];
	UIImage *stretchableButtonImagePressed = [buttonImagePressed stretchableImageWithLeftCapWidth:12 topCapHeight:0];
	
	[self stylizeButtonWithNormalStateImage:stretchableButtonImageNormal PressedStateImage:stretchableButtonImagePressed];
}

- (BOOL)stylizeButtonWithImage:(UIImage *)imageToCalibrateWith
{
	return [self stylizeButtonWithNormalStateImage:imageToCalibrateWith PressedStateImage:imageToCalibrateWith];

}

- (BOOL)stylizeButtonWithNormalStateImage:(UIImage *)normalStateImage PressedStateImage:(UIImage *)pressedStateImage
{	
	[self setBackgroundImage:normalStateImage forState:UIControlStateNormal];
	[self setBackgroundImage:pressedStateImage forState:UIControlStateHighlighted];
	
	return YES;
}

@end
